<template>
  <u-popup :safeAreaInsetTop="false" :safeAreaInsetBottom="false" mode="center" round="20rpx" :show="show"
    @close="close" @open="open">
    <view class="pad-40" style="padding-bottom: 0rpx; overflow: hidden">
      <view class="title flex-center-center fs-36 fw-500 mb-32">{{
        title
      }}</view>
      <view class="content c-677585 fs-28">
        <u-parse :content="content"></u-parse>
      </view>
      <view class="btn btn-active" @click="close">{{ btnText }}</view>
    </view>
  </u-popup>
</template>
<script>
import { richTxtApi } from "@/services/common";
export default {
  props: {
    btnText: {
      type: String,
      default: "好的，我知道了",
    },
    title: {
      type: String,
      default: "标题",
    },
  },
  data() {
    return {
      show: false,
      content: "",
    };
  },
  mounted() {
    this.getRichTxt();
  },
  methods: {
    close() {
      this.show = false;
    },
    open() {
      this.show = true;
    },
    getRichTxt() {
      richTxtApi({ id: 5 }).then((res) => {
        this.content = res.data?.rich_info.content || "";
      });
    },
  },
};
</script>
<style lang="scss" scoped>
.content {
  width: 596rpx;
  box-sizing: border-box;
  padding-bottom: 32rpx;
  max-height: 500rpx;
  overflow-y: auto;
  line-height: 39.2rpx;
}

.btn {
  height: 96rpx;
  border-top: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -40rpx;
  margin-right: -40rpx;
}
</style>
